/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.member.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.wealth.platform.entity.Account;
import com.wealth.system.entity.Corporation;

/**
 * @author chan
 */
 @Entity
@Table(name = "t_member_membership")
public class Membership implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private String openid;
	private Member member;
	private Corporation corp;
	private Account account;
	
	
	
	
	/* ---------------- method ----------------*/
	
	public Membership(){
	}

	public Membership(Long id){
		this.id = id;
	}

	/* ---------------- getter/setter ----------------*/
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "openid")
	public String getOpenid() {
		return openid;
	}
	
	public void setOpenid(String openid) {
		this.openid = openid;
	}

	@ManyToOne
	@JoinColumn(name="member_id")
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@ManyToOne
	@JoinColumn(name="corp_id")
	public Corporation getCorp() {
		return corp;
	}

	public void setCorp(Corporation corp) {
		this.corp = corp;
	}

	@ManyToOne
	@JoinColumn(name="account_id")
	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
	
}



